home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MWNUG-Sept1993 / TheDelegate.h < prev    next >
Text File  |  1995-06-12  |  2KB  |  47 lines

  1.  
  2. /*-----------------------------------------------------------------------------------------------
  3.    A simple example of browsers and delegation
  4.  
  5.      This code is free and in the public domain.  Use it for any purpose you see fit.
  6.      The editor is set to a width of 130 columns with a tab setting of 2 spaces per tab,
  7.      so it will look pretty strange unless you modify your tabs accordingly.
  8.      
  9.      This is a simple example of delegation.  The browser in the nib file uses
  10.      this object as a delegate, and calls browser:fillMatrix:inColumn: to fill
  11.      itself with data.  
  12.  
  13.      HISTORY
  14.  
  15.         27Sep93    DM    Finished off
  16.         14Sep93    DM    Newly created, Don McGregor    
  17.  
  18. -----------------------------------------------------------------------------------------------*/
  19.  
  20. #import <appkit/appkit.h>
  21. #import <objc/Storage.h>
  22.  
  23. @interface TheDelegate:Object
  24. {
  25.     id                theBrowser;                                                    // (NXBrowser*) Hooked up to the browser object in the .nib file
  26.     Storage        *loggedOnNames;                                            // (Storage*) object that holds the names of everyone logged on
  27. }
  28.  
  29.     // *** Public methods
  30.     
  31. - refreshHit:sender;                                                        // Refresh button hit
  32.  
  33.  
  34.     // *** Delegate methods
  35.  
  36. - (int)browser                                                                    // RETURN: the number of cells loaded into the browser
  37.         :sender                                                                            // INPUT:  the browser that sent us the message
  38.         fillMatrix:matrix                                                        // INPUT:  the matrix being added to
  39.         inColumn:(int)column;                                                // INPUT:  which column of the browser is being loaded
  40.  
  41.  
  42.     // *** Private methods
  43.  
  44. -(Storage*)    getNames;                                                        // RETURN:  Storage object that contains the names of everyone logged on
  45.  
  46. @end
  47.